package com.example.qundui.learndemo.lvtest;
import android.support.v7.util.DiffUtil;
import java.util.List;
/**
 * Created by qundui on 2017/5/5.
 */
public class MyUtils  extends DiffUtil.Callback{
    private List<String> olddatas;
    private List<String> newDatas;
    public MyUtils(List<String> olddatas, List<String> newDatas) {
        this.olddatas = olddatas;
        this.newDatas = newDatas;
    }
    public int getOldListSize() {
        return olddatas.size();
    }
    public int getNewListSize() {
        return newDatas.size();
    }
    public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
        return olddatas.get(oldItemPosition).equals(newDatas.get(newItemPosition));
    }
    public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
        return olddatas.get(oldItemPosition).equals(newDatas.get(newItemPosition));
    }
}
